<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="oneroom.admin.code.codeModel" %>
<jsp:useBean id="code" scope="page" class="oneroom.admin.code.codeService" />
<%
	codeModel model = code.setRequest(request);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>코드관리</title>
<script type="text/javascript" src="/js/jquery-1.3.2.min.js"></script>
<script type="text/javascript">
<!--
$(document).ready(function(){

	<% 
		if(model.getGubun().equals("I")){
			if(model.isReturnVal()){
	%>
			alert("등록 되었습니다.");
			window.location.href="main_list.jsp";
	<%			
			}else{
	%>				
			alert("등록 실패 하였습니다.");
			window.location.href="main_list.jsp";
	<%
			}
		}else if(model.getGubun().equals("U")){
			if(model.isReturnVal()){
	%>
			alert("수정 되었습니다.");
			window.location.href="main_list.jsp";
	<%
			}else{
	%>
			alert("수정 실패 하였습니다.");
			window.location.href="main_list.jsp";
	<%
			}
		}else if(model.getGubun().equals("D")){
			if(model.isReturnVal()){
	%>
			alert("삭제 되었습니다.");
			window.location.href="main_list.jsp";
	<%
			}else{
	%>
			alert("삭제 실패 하였습니다.");
			window.location.href="main_list.jsp";
	<%
			}
		}else if(model.getGubun().equals("DI")){
			if(model.isReturnVal()){
	%>
			alert("등록 되었습니다.");
			window.location.href="list.jsp?hdrcode=<%=model.getHdrcode()%>";
	<%
			}else{
	%>
			alert("등록 실패 하였습니다.");
			window.location.href="list.jsp?hdrcode=<%=model.getHdrcode()%>";
	<%
			}
		}else if(model.getGubun().equals("DU")){
			if(model.isReturnVal()){
	%>
			alert("수정 되었습니다.");
			window.location.href="list.jsp?hdrcode=<%=model.getHdrcode()%>";
	<%
			}else{
	%>
			alert("수정 실패 하였습니다.");
			window.location.href="list.jsp?hdrcode=<%=model.getHdrcode()%>";			
	<%
			}
		}else if(model.getGubun().equals("DD")){
			if(model.isReturnVal()){
	%>
			alert("삭제 되었습니다.");
			window.location.href="list.jsp?hdrcode=<%=model.getHdrcode()%>";
	<%
			}else{
	%>
			alert("삭제 실패 하였습니다.");
			window.location.href="list.jsp?hdrcode=<%=model.getHdrcode()%>";
	<%
			}
		}
	%>
});	
//-->
</script>
</head>
</html>